const Router = require('koa-router');
//验证的中间件
const { verifyLogin,verifyToken} = require('../middleWare/middleWare');
//颁发签名的中间件
const {sign,test} = require('../controller/login.controller')


const loginRouter = new Router({
    prefix: '/login'
});

//登录时要进行验证:先验证用户是否合法,再验证用户密码这些,然后再颁发凭证
loginRouter.post('/', verifyLogin, sign);
//用户访问资源文件test
loginRouter.get('/test',verifyToken,test);

module.exports = loginRouter
